home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12655 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  37 lines

  1. Newsgroups: slac.comp.computefarm,comp.lang.c++
  2. Path: ganymede.SLAC.Stanford.EDU!gas
  3. From: gas@ganymede.SLAC.Stanford.EDU (Glenn A. Horton-Smith)
  4. Subject: To run on pinto's, code must link statically to libxlf.a
  5. Message-ID: <DoLEJn.Ls9@unixhub.SLAC.Stanford.EDU>
  6. Sender: news@unixhub.SLAC.Stanford.EDU
  7. Organization: Stanford Linear Accelerator Center
  8. Distribution: site
  9. Date: Thu, 21 Mar 1996 00:54:58 GMT
  10.  
  11. Here is a strange gotcha that will probably only affect people who
  12. link Fortran packages (like HBOOK) into non-Fortran (C, C++) code, and
  13. possibly some others.  It caused me some temporary confusion, so I
  14. thought I would share the solution.
  15.  
  16. The Fortran run-time library file "libxlf.a" is not present in the
  17. /usr/lib directories of any of the pinto machines that I have checked.
  18. Therefore, although AIX allows for you to link to this library as a
  19. "sharable" (thereby reducing the size of your executable), you must
  20. not do this, or else your code will not run when submitted via bsub.
  21. You will get error messages like the following:
  22.   Could not load program /u/ei/gas/my_analysis/pedestals 
  23.   Could not load library libxlf.a[shr.o]
  24.   Error was: No such file or directory
  25.  
  26. The xlf command itself links in libxlf.a statically be default, so
  27. pure Fortran code should work fine, unless you've made a special
  28. effort to have the library linked in the sharable manner.  On the
  29. other hand, it seems that "g++" links in libraries as sharables
  30. whenever it can, unless you specify the "-static" option.  Therefore,
  31. my C++ code which calls HBOOK failed as above when bsub'ed (but ran
  32. fine on morgan05) until I re-created the executable with the -static
  33. option.
  34.  
  35. Hope that's helpful to someone.
  36.                             -Glenn
  37.